package com.ruoyi.business.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.TOrderItemMapper;
import com.ruoyi.business.domain.TOrderItem;
import com.ruoyi.business.service.ITOrderItemService;

/**
 * 订单商品Service业务层处理
 * 
 * @author laoguo
 * @date 2025-08-12
 */
@Service
public class TOrderItemServiceImpl implements ITOrderItemService 
{
    @Autowired
    private TOrderItemMapper tOrderItemMapper;

    /**
     * 查询订单商品
     * 
     * @param itemId 订单商品主键
     * @return 订单商品
     */
    @Override
    public TOrderItem selectTOrderItemByItemId(Long itemId)
    {
        return tOrderItemMapper.selectTOrderItemByItemId(itemId);
    }

    /**
     * 查询订单商品列表
     * 
     * @param tOrderItem 订单商品
     * @return 订单商品
     */
    @Override
    public List<TOrderItem> selectTOrderItemList(TOrderItem tOrderItem)
    {
        return tOrderItemMapper.selectTOrderItemList(tOrderItem);
    }

    /**
     * 新增订单商品
     * 
     * @param tOrderItem 订单商品
     * @return 结果
     */
    @Override
    public int insertTOrderItem(TOrderItem tOrderItem)
    {
        return tOrderItemMapper.insertTOrderItem(tOrderItem);
    }

    /**
     * 修改订单商品
     * 
     * @param tOrderItem 订单商品
     * @return 结果
     */
    @Override
    public int updateTOrderItem(TOrderItem tOrderItem)
    {
        return tOrderItemMapper.updateTOrderItem(tOrderItem);
    }

    /**
     * 批量删除订单商品
     * 
     * @param itemIds 需要删除的订单商品主键
     * @return 结果
     */
    @Override
    public int deleteTOrderItemByItemIds(Long[] itemIds)
    {
        return tOrderItemMapper.deleteTOrderItemByItemIds(itemIds);
    }

    /**
     * 删除订单商品信息
     * 
     * @param itemId 订单商品主键
     * @return 结果
     */
    @Override
    public int deleteTOrderItemByItemId(Long itemId)
    {
        return tOrderItemMapper.deleteTOrderItemByItemId(itemId);
    }
}
